package com.street.controller.admin;

import com.street.dto.ShopDTO;
import com.street.result.Result;
import com.street.service.ShopService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("adminShopController")
@RequestMapping("/admin/shop")
@Slf4j
public class ShopController {
    @Autowired
    ShopService shopService;

    @PutMapping("/modify")
    public Result updateShop(@RequestBody ShopDTO shopDTO){
        shopService.updateShop(shopDTO);
        return Result.success();
    }

    @PostMapping("/status/{status}")
    public Result changeStatus(@PathVariable Integer status ,Integer shopId){
        shopService.changeStatus(status,shopId);
        return Result.success();
    }
}
